

use "$data/clean/clean_main_complete.dta" , replace



gen coeff = .
gen ci_u =.
gen ci_l =.
cap drop x

 gen x = 1.6 in 1
replace x = 1.9 in 2

  

 xi: reg any_doors  1.treat_any##1.voice_prior_high $control , vce(r) // 
 
 replace coeff = _b[1.treat_any] in 1
 replace ci_u = _b[1.treat_any] + 1.96*_se[1.treat_any] in 1
 replace ci_l = _b[1.treat_any] - 1.96*_se[1.treat_any] in 1
 
 lincom  1.treat_any + 1.treat_any#1.voice_prior_high
 
  replace coeff = r(estimate)   in 2
 replace ci_u = r(estimate)   + 1.96*r(se) in 2
 replace ci_l = r(estimate)  - 1.96*r(se) in 2
 


   
twoway (scatter coeff x  ) (rcap ci_u ci_l x), ytitle("Any doors") xtitle(" ") xlab(1.6 "Low prior voice" 1.9  "High prior voice") legend(pos(6) rows(1) order(1 "Any voice treatment" 2 "Confidence interval")) xscale(range(1.4 2.1)) text(0.06 1.75 "*", size(vlarge)) yline(0 , lcolor(red))

graph export "$output/voice_prior_doors_any_coeffplot.pdf" , replace

 
  xi: reg z_score_fs 1.treat_any##1.voice_prior_high $control , vce(r) // 
 
 replace coeff = _b[1.treat_any] in 1
 replace ci_u = _b[1.treat_any] + 1.96*_se[1.treat_any] in 1
 replace ci_l = _b[1.treat_any] - 1.96*_se[1.treat_any] in 1
 
 lincom  1.treat_any + 1.treat_any#1.voice_prior_high
 
 replace coeff = r(estimate)   in 2
 replace ci_u = r(estimate)   + 1.96*r(se) in 2
 replace ci_l = r(estimate)  - 1.96*r(se) in 2



twoway (scatter coeff x  ) (rcap ci_u ci_l x), ytitle("Voice index (z)") xtitle(" ") xlab(1.6 "Low prior voice" 1.9  "High prior voice") legend(pos(6) rows(1) order(1 "Any voice treatment" 2 "Confidence interval")) xscale(range(1.4 2.1)) text(0.375 1.75 "**", size(vlarge)) yline(0 , lcolor(red))
   
graph export "$output/voice_prior_fs_any_coeffplot.pdf" , replace
